package jwr.basic;

public class Patterns {

	public static void main(String[] args) {
		int i,j,cnt;
		
		i=1;
		
		System.out.println("Pattern I");
		System.out.println("");
		while(i<=6){
			j = 1;
			while(j<=i){
				if(j == i){
					System.out.println(j);
				}else{
					System.out.print(j+ " ");
				}
				j++;
			}
			i++;	
		}
		
		System.out.println("");
		System.out.println("Pattern II");
		System.out.println("");
		i=1;
		
		while(i<=6){
			j = 1;
			cnt = 7-i;
			while(cnt >=1){
				if(j == 7-i){
					System.out.println(j);
				}else{
					System.out.print(j+ " ");
				}
				j++;
				cnt--;
			}
			i++;	
		}
		System.out.println("");
		System.out.println("Pattern III");
		System.out.println("");
		int num=7;
		
		i = 6;
		while(i>=1){
			j = 1;
			while(j<=6){
				if(j<i){
					System.out.print(" ");
				}else if(j==6){
					System.out.println(num-j);
				}else{
					System.out.print(num-j);
				}
				j++;
			}
			i--;
		}
		
		System.out.println("");
		System.out.println("Pattern IIII");
		System.out.println("");
		
		i = 1;
		
		while(i<=6){
			j = 1;
			while(j<=6){
				if(j <i){
					System.out.print(" ");
				}else{
					System.out.print(j-i+1);
				}
				j++;
			}
			System.out.println(" ");
			i++;
		}
		System.out.println("");
		System.out.println("Pattern IIII for문이용");
		System.out.println("");
		for(i = 1; i <= 6 ; i++){
			for(j = 1; j <= 6; j++){
				if(j <i){
					System.out.print(" ");
				}else{
					System.out.print(j-i+1);
				}
			}
			System.out.println(" ");
		}
		
	}
}
